package main;

import entity.Pet;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.PetService;

public class SpringTest {
    public static void main(String[] args) throws BeansException {
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Pet pet = (Pet) context.getBean("pet");
        PetService petService = (PetService) context.getBean("petService");
        petService.save(pet);
        pet.introduce();
    }
}
